// 1. 安装mockjs

// 2. 引入mockjs

// 3. 调用mock方法模拟数据


const Mock = require('mockjs');

let data = Mock.mock({
    "memberList|2-8" : [
        {
            "id|+1" : 1,
            "name|1-5" : "小梦",
            "phone|11" : "8",
            "age|1-120" : 0,
            "salary|20-50.1-5" : 0,
            "status|1" : true,
            "open|2-4" : true,
            "order|2" : {"id" : 1, "name" : "jack", "age" : 100},
            "order2|2-3" : {"id" : 1, "name" : "jack", "age" : 100},
            "idCard" : /\d{15}|\d{18}/    
        }
    ]
})

//将模拟出来的数据转换成json格式,并且格式化数据,让数据有2个空格的缩进
console.log(JSON.stringify(data,null,2))